Why does the provided JavaScript code return different values in each case

welcome to shbcf.ru